﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NCP.Recruiting.ApplicationServices.Interfaces;
using NCP.Recruiting.WebApp.Models;
using NCP.Recruiting.ApplicationServices.Messaging;
using NCP.Recruiting.ApplicationServices.Messaging.Companies;
using NCP.Recruiting.ApplicationServices.ViewModels;

namespace NCP.Recruiting.WebApp {
    public static class CompanyAppServicesExtensions {
        public static User GetUserFromIdentity(this ICompanyAppService service, RecruitingIdentity identity) {
            var response = service.GetUser(new GetUserRequest(identity.UserId));
            return response.AuthenticatedUser;
        }
    }
}